#!/bin/bash

# 根据等级输出到日志
function echo_log(){
  case $1 in
      0)
        level="info"
        msg=${@:2}
      ;;
      1)
        level="main"
        msg=${@:2}
      ;;
      2)
        level="warn"
        msg=${@:2}
      ;;
      3)
        level="error"
        msg=${@:2}
      ;;
      *)
        level="info"
        msg=$@
      ;;
  esac
    echo -e "[$(date "+%Y-%m-%d %H:%M:%S")] [$level] $msg" >> $install_log
    # echo "[$(date "+%Y-%m-%d %H:%M:%S")] [信息] 版本：$InstallVersion" >> $install_log
}